
<style type="text/css">
body {
	font-family:verdana,arial,sans-serif;
	font-size:10pt;
	margin:30px;
	background-color:#ffcc00;
	}
</style>
</head>


<a href ="addbook.php" target = "_top">Add another Book</a><br />

<?php    

$username="bsc353_4";
$password="sonbeans";
$database="bsc353_4";


$price= intval($_POST['price']) * 100;
$year=$_POST['year'];
$ISBN=$_POST['ISBN'];
$author=$_POST['author'];
$subject=$_POST['subject'];
$publisher=$_POST['publisher'];
$title=$_POST['title'];


echo "price in cents is: $price \n";

mysql_connect("clipper.encs.concordia.ca",$username,$password) or die ("Unable to connect to database");

@mysql_select_db($database) or die ("Unable to select database");


// Check connection


$query="INSERT INTO Book VALUES ($price, '$year', '$ISBN', '$author', '$subject', '$publisher',
                        '$title', 0);";

//echo "query: $query \n"; 
mysql_query($query) or die ("failed to add record");



echo "1 record added";


mysql_close();
?> 

